package com.zhangfuyin.controller;

import com.zhangfuyin.student.entity.Student;
import com.zhangfuyin.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class UserController {


    @Autowired
    private StudentService studentService;

    @RequestMapping("/doLogin")
    public ModelAndView doLogin(){
        Student student = new Student();
        student.setAge(20);
        student.setName("zhangfuyin");
        student.setClassesId(20001);


        studentService.insertStu(student);
        ModelAndView mv = new ModelAndView();
        mv.setViewName("welcome");
        return mv;
    }


}
